/**
 * 
 */
package com.seascape.swms.system.shiro;

import org.apache.shiro.authc.credential.CredentialsMatcher;
import org.apache.shiro.session.mgt.SessionManager;
import org.beetl.sql.core.SQLManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author Lay
 *
 */
@Configuration
public class ShiroConfig {

    @Bean
    public SimpleShiroRealm simpleShiroRealm(SQLManager sqlManager,CredentialsMatcher credentialsMatcher) {
    	SimpleShiroRealm simpleShiroRealm = new SimpleShiroRealm();
    	simpleShiroRealm.setSqlManager(sqlManager);
    	simpleShiroRealm.setCredentialsMatcher(credentialsMatcher);
        return simpleShiroRealm;
    }

    @Bean
    public SessionManager sessionManager() {
        return new SimpleSessionManager();
    }

}
